﻿@page "/Storages"
@attribute [TabItemOption(Text = "存取设置")]

<a href="https://www.nuget.org/packages/BootstrapBlazor.WebAPI#readme-body-tab"><h3>Cookie/LocalStorage</h3></a>
<hr />
<a href="https://github.com/densen2014/Densen.Extensions/blob/master/Demo/DemoShared/Pages/Storages.razor"><h5>页面源码</h5></a>

<div class="container">
    <main role="main" class="pb-1 m-5">
        <div class="d-flex justify-content-center align-items-center">
            <h4>APP名称</h4>
        </div>
        <br />
        <br />
        <br />
        <div class="d-flex justify-content-center align-items-center">
            <section>
                <Tab IsLazyLoadTabItem="true">
                    <TabItem Text="登录">
                        <ValidateForm Model="@Model" OnValidSubmit="@OnValidSubmit">

                            <h2>使用账号和密码登录</h2>
                            <hr />
                            <div class="mb-3">
                                <BootstrapInput @bind-Value="@Model.Username" />
                            </div>
                            <div class="mb-3">
                                <BootstrapPassword @bind-Value="@Model.Password" />
                            </div>
                            <div>
                                <Button IsBlock ButtonType="ButtonType.Submit" IsAsync Text=" 登 录 "></Button>
                            </div>
                            <div class="mb-3">
                                <Switch @bind-Value="@Model.Remember" />
                            </div>
                            <div class="mb-3">
                                @if (Model.Remember)
                                {
                                    <Switch @bind-Value="@Model.RememberPassword" />
                                }
                            </div>
                        </ValidateForm>
                    </TabItem>
                    <TabItem Text="注册">
                        <ValidateForm Model="@NewUser" OnValidSubmit="@OnValidRegister">

                            <h2>注册新账号,注册后请联系管理员激活</h2>
                            <hr />
                            <div class="mb-3">
                                <BootstrapInput @bind-Value="@NewUser.FullName" />
                            </div>
                            <div class="mb-3">
                                <BootstrapInput @bind-Value="@NewUser.Company" />
                            </div>
                            <div class="mb-3">
                                <BootstrapInput @bind-Value="@NewUser.Username" />
                            </div>
                            <div class="mb-3">
                                <BootstrapPassword @bind-Value="@NewUser.Password" />
                            </div>
                            <div class="mb-3">
                                <BootstrapPassword @bind-Value="@NewUser.ConfirmPassword" />
                            </div>
                            <div>
                                <Button IsBlock ButtonType="ButtonType.Submit" IsAsync Text=" 注册账号 "></Button>
                            </div>
                            <div class="mb-3">
                                <Switch @bind-Value="@Model.Remember" />
                            </div>
                            <div class="mb-3">
                                @if (Model.Remember)
                                {
                                    <Switch @bind-Value="@Model.RememberPassword" />
                                }
                            </div>
                        </ValidateForm>
                    </TabItem>
                </Tab>
            </section>
        </div>
    </main>
</div><code>@message</code>


<AttributeTable Items="@GetAttributes()" />

